#include<stdio.h>
#include<stdlib.h>
#include<signal.h>
#include<unistd.h>

void sigcb(int signum)
{
    printf("Received signal:%d\n",signum);
    exit(signum);
}

int main()
{
    if(signal(SIGINT,sigcb) == SIG_ERR)
    {
        perror("signal");
        exit(EXIT_FAILURE);
    }

    while (1)
    {
        /* code */
        pause();
    }

    return 0;
    
}